package com.book.service.impl;

import com.book.entity.GlobalStatistics;
import com.book.mapper.BookMapper;
import com.book.mapper.UserMapper;
import com.book.service.StatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author zzw2000
 * @Date 2022年08月28日 10:37
 * @Description 描述
 */
@Service
public class StatisticsServiceImpl implements StatisticsService {
    @Resource
    private UserMapper userMapper;
    @Resource
    private BookMapper bookMapper;


    @Override
    public GlobalStatistics getStatistics() {
        return new GlobalStatistics(
                userMapper.getStudentQuantity(),
                bookMapper.getBookQuantity(),
                bookMapper.getBorrowCount());
    }
}
